/**
 * Copyright (c) 2015-2019, Golly Hu 胡高 (3722711@qq.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.hg.jfsa.web.service.api;

import java.util.List;
import java.util.Map;

import com.jfinal.plugin.activerecord.Page;

import cn.hg.jfsa.model.Cases;
import cn.hg.jfsa.model.CasesCategory;
import cn.hg.jfsa.model.CasesImage;

/**
 * @author Golly
 */
public interface CasesServiceApi {

	/**
	 * 取得案例
	 *
	 * @param id
	 *
	 * @return
	 */
	Cases getCases (int id);

	/**
	 * @param code
	 *
	 * @return
	 */
	List<CasesCategory> getCasesCategoryList (Map<String, Object> paraMap);

	/**
	 * 取得案例图片列表
	 *
	 * @param paraMap
	 *
	 * @return
	 */
	List<CasesImage> getCasesImageList (Map<String, Object> paraMap);

	/**
	 * 获取案例
	 *
	 * @param index
	 *            页数
	 * @param size
	 *            条数
	 * @param categoryId
	 *            （可选）分类ID
	 * @param title
	 *            （可选）标题，模糊查询
	 * @param keyword
	 *            （可选）关键字，模糊查询
	 *
	 * @return 案例Page对象
	 */
	Page<Cases> getCasesPage (int index, int size, Map<String, Object> paraMap);

	Page<Cases> getCasesResultPage (int index, int size, Map<String, Object> paraMap);

	/**
	 * 取得下一个案例
	 *
	 * @param id
	 *
	 * @return
	 */
	Cases getNextCases (int id, Map<String, Object> paraMap);

	/**
	 * 取得上一个案例
	 *
	 * @param id
	 *
	 * @return
	 */
	Cases getPrevCases (int id, Map<String, Object> paraMap);

	/**
	 * 取得随机案例列表
	 *
	 * @param paraMap
	 *
	 * @return
	 */
	Page<Cases> getRandomCasesList (Map<String, Object> paraMap);

}
